package product

import (
	"go.uber.org/fx"
	"mallgo/core"
	"mallgo/internal/resources/product/repository"
	"mallgo/internal/resources/product/resource"
)

func InitRouter(productResource *resource.ProductResource, s *core.AppServer) {
	// 用户路由
	newProductController := NewProductController(productResource)
	s.Engine.GET("/createProduct", newProductController.create)

}

var Module = fx.Options(
	fx.Provide(
		resource.NewProductResource,
		repository.NewProductRepository,
		NewProductController,
	),
	fx.Invoke(
		InitRouter,
	),
)
